// compile: g++ -o forward_list forward_list.cc -std=c++11
// run: ./forward_list
#include <algorithm>
#include <forward_list>
#include <iostream>
using namespace std;

void Print(const forward_list<int>& fl) {
  for (auto it = fl.begin(); it != fl.end(); it++) {
    cout << *it << " ";
  }
  cout << endl;
}
void Test1() {
  forward_list<int> fl;
  fl.push_front(0);
  fl.push_front(1);
  fl.push_front(2);
  Print(fl);
  auto it = find(fl.begin(), fl.end(), 1);
  fl.insert_after(it, 10);
  fl.erase_after(fl.begin());
  fl.pop_front();
  Print(fl);
}
void Test2() {}
int main() {
  Test1();
  Test2();
  return 0;
}
